From 19639473bacb0d30dc432822b980e7b91c9ffe07 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Wed, 14 Jun 2006 23:58:02 +0000 Subject: [PATCH] Add one trackpoint only one time to queue. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2157 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/nmea.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gpsbabel/nmea.c b/gpsbabel/nmea.c index b8cab9e5a..51573143a 100644 --- a/gpsbabel/nmea.c +++ b/gpsbabel/nmea.c @@ -146,6 +146,7 @@ static short_handle mkshort_handle; static preferred_posn_type posn_type; static struct tm tm; static waypoint * curr_waypt = NULL; +static waypoint * last_waypt = NULL; static int without_date; /* number of created trackpoints without a valid date */ static struct tm opt_tm; /* converted "date" parameter */ @@ -197,6 +198,8 @@ nmea_cksum(const char *const buf) static void nmea_rd_init(const char *fname) { + curr_waypt = NULL; + last_waypt = NULL; file_in = xfopen(fname, "r", MYNAME); } @@ -731,7 +734,10 @@ nmea_read(void) while (fgets(ibuf, sizeof(ibuf), file_in)) { nmea_parse_one_line(ibuf); if (lt < last_read_time && curr_waypt && trk_head) { - track_add_wpt(trk_head, curr_waypt); + if (curr_waypt != last_waypt) { + track_add_wpt(trk_head, curr_waypt); + last_waypt = curr_waypt; + } lt = last_read_time; } } -- 2.30.2